home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / pascal / xlib.zip / XCOLLECT.DOC < prev    next >
Text File  |  1992-09-06  |  4KB  |  145 lines

  1.  
  2.                                 XCollect
  3.                                 --------
  4.  
  5. This unit give some more collection objects for your Turbo-Vision
  6. programing.
  7.  
  8.  
  9. TFiFoCollection
  10. ~~~~~~~~~~~~~~~
  11.  
  12. "TFiFoCollection" is a stack build upon the TCollection object.
  13. Can be used to build every type of stack. FiFo means first-in/
  14. first-out.
  15.  
  16.  Methods
  17.  -------
  18.  procedure Push( P : Pointer ); virtual;
  19.  Push an object to the stack
  20.  
  21.  function  Pop : Pointer;       virtual;
  22.  Pop an object from the stack. Return nil if no more objects on
  23.  stack. Note that you must Dispose all objects you get via this
  24.  method yourself after use, because the pop function remove the
  25.  object from the stack.
  26.  
  27.  function  LookAHead:Pointer;   virtual;
  28.  Same as Pop but only look for the object. Doesn't remove it from
  29.  the stack
  30.  
  31. TLiFoCollection
  32. ~~~~~~~~~~~~~~~
  33.  
  34. "TLiFoCollection" is a stack build upon the TCollection object.
  35. Can be used to build every type of stack. LiFo means last-in/
  36. first-out.
  37.  
  38.  Methods
  39.  -------
  40.  procedure Push( P : Pointer ); virtual;
  41.  Push an object to the stack
  42.  
  43.  function  Pop : Pointer;       virtual;
  44.  Pop an object from the stack. Return nil if no more objects on
  45.  stack. Note that you must Dispose all objects you get via this
  46.  method yourself after use, because the pop function remove the
  47.  object from the stack.
  48.  
  49.  function  LookAHead:Pointer;   virtual;
  50.  Same as Pop but only look for the object. Doesn't remove it from
  51.  the stack
  52.  
  53.  
  54. TIntegerItem
  55. ~~~~~~~~~~~~~
  56.  
  57. "TIntegerItem" is the object which used in the sorted "TIntegerCollection".
  58. Only held one integer value in it.
  59.  
  60.  Fields:
  61.  -------
  62.  Item : Integer         The value for the object
  63.  
  64.  Methods
  65.  -------
  66.  constructor Init ( AItem:Integer )
  67.  Initalize Item to AItem
  68.  
  69. TIntegerCollection
  70. ~~~~~~~~~~~~~~~~~~
  71.  
  72. "TIntegerCollection" is a sorted integer collection, based on the
  73. "TIntegerItem". Can be used for sort integers.
  74.  
  75.  Methods:
  76.  --------
  77.   function Compare(Key1, Key2: Pointer): Integer; virtual;
  78.   Compare two items against another.
  79.  
  80.   function KeyOf(Item: Pointer): Pointer; virtual;
  81.   Return a pointer to a TIntegerItem
  82.  
  83. TOverflowCollection
  84. ~~~~~~~~~~~~~~~~~~~
  85.  
  86. This collection helds only some items at time. Can ideal used
  87. for dynamic buffers like those used in terminal-programs.
  88.  
  89.  Fields:
  90.  -------
  91.  MaxItems  : Integer;     How much items can the collection hold at time
  92.  
  93.  Methods:
  94.  --------
  95.  constructor Init( ALimit,ADelta,AMax: Integer );
  96.  Initalize the collection to AMax items at time
  97.  
  98.  procedure Insert( Item:Pointer ); virtual;
  99.  Insert an item to the collection. If the collection would be contain
  100.  more that MaxItems Items than the first item will be deleted
  101.  automatically.
  102.  
  103. TStrCollection
  104. ~~~~~~~~~~~~~~
  105.  
  106. Same as "TStringCollection" but unsorted. Can be used for
  107. read in text file from resources !
  108.  
  109. TPtrCollection
  110. ~~~~~~~~~~~~~~
  111.  
  112. This collection can be used to collect other object pointers,
  113. without dispose than after use. I use this collection for
  114. handle a Turbo IDE like Window List. The items would be
  115. the PWindow pointers !
  116.  
  117. TSingleCollection
  118. ~~~~~~~~~~~~~~~~~
  119.  
  120. This collection is my own aproach to build a container class.
  121. It don't held the items as a dynamic array as TCollection,
  122. but the collection is the object itself. With this collection
  123. you can easy build structures like
  124.  
  125. NewMenu( .... ( NewSubMenu ( ..., nil ))));
  126.  
  127. but totally object-oriented, not procedural as TurboVision ones.
  128.  
  129. Other stuff:
  130. ~~~~~~~~~~~~
  131.  
  132.  Procedure RegisterXCollect;
  133.  
  134.  Register all the object in this unit
  135.  
  136.  
  137.  
  138.  
  139.  
  140.  
  141.  
  142.  
  143.  
  144.  
  145.